package Method;

/**
 * ClassName:MethodDemo9
 * Package:Method
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/1/12-1:20
 * @Version:v1.0
 */
public class MethodDemo9 {
    //方法的重载(同一个类中,方法名相同,参数不同的方法,与返回值无关)
    //参数不同：个数不同,类型不同,顺序不同
    public static void main(String[] args) {
        int a=3;
        int b=4;
        compare(a,b);
        compare((int)4,(int)5);
        compare(4,5);

    }
    public static void compare(byte a,byte b){
        System.out.println("byte");
        System.out.println(a == b);
    }
    public static void compare(short a,short b){
        System.out.println("short");
        System.out.println(a == b);
    }
    public static void compare(int a,int b){
        System.out.println("int");
        System.out.println(a == b);
    }
    public static void compare(long a,long b){
        System.out.println("long");
        System.out.println(a == b);
    }
}
